<template>
  <!--收款-->
  <div class="shoukuan">
    <div class="saocontent" @click="showScan()">
      <p><img src="../../assets/sao.png" alt="" width="85"></p>
      <ul>
        <li>扫一扫收款确认</li>
        <li>要确认要收到会员支付的款项， 才可进行收款确认呦</li>
      </ul>
    </div>
    <router-link to="/shuzishoukuan">
      <wv-button type="default" :mini="true" class="shuzi">数字码收款确认</wv-button>
    </router-link>
    <router-link to="/shoukuanjilu">
      <wv-button type="default" :mini="true" class="jilu">收款确认记录</wv-button>
    </router-link>
    <div class="des">
      <p class="title">使用说明</p>
      <ul>
        <li><p>第一种 </p>1.点击“扫一扫收款确认”——输入会员点选线下支付后，会员手机页面生成的二维码。</li>
        <li><p>第二种 </p>1.点击“数字码收款确认”——输入会员点选线下支付后，会员手机页面生成的二维码下的数字码。</li>
      </ul>
    </div>
  </div>
</template>
<script type="text/ecmascript-6">
  import {gathering_money} from '../../../test/unit/http'
  import {wxApi} from '../../../test/unit/flyme_weixin'
  import {Toast} from 'we-vue'
  export default {
    name: '',
    props: {},
    data() {
      return {
      };
    },
    methods: {
      init(){

      },
      getData(params){
        gathering_money(params).then(res => {
          if (res.code === 100) {
            var order = res.object;
            this.$router.push({name: 'confirmshoukuan', query: {'orderId': order.orderId}})
          } else {
            Toast.fail(res.info);
          }
        })
      },
      showScan(){
        var that = this;
        wxApi.scanQRCode({
          callback: function (res) {
            var orderCode = res.resultStr;//7890
            let params = {
              orderCode: orderCode,
            };
            that.getData(params)
          }
        });
      }
    },
    created() {
      wxApi.init();
    },
    components: {}
  }
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less" rel="stylesheet/less">
  .uploadtitle {
    font-size: 13px;
    color: #f98e3c;
    margin: 10px 10px 0;
    text-align: left;
  }

  .upload {
    border: 2px dashed #f98e3c;
    text-align: center;
    color: #f98e3c;
    font-size: 13px;
    padding: 30px 10px;
    margin: 15px 10px 70px;
    p {
      margin-bottom: 10px;
    }
  }

  .des {
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 5px;
    padding: 20px 10px;
    margin: auto;
    margin-top: 15px;
    .title {
      font-size: 20px;
      color: #111;
      margin-bottom: 10px;
    }
    ul {
      li {
        color: #666;
        font-size: 15px;
        line-height: 25px;
        text-align: left;
        p {
          color: #111;
        }
      }

    }
  }

  button {
    height: 50px;
    line-height: 50px;
    font-size: 17px;
    width: calc(50% - 10px);
    margin-top: 15px;
  }

  .shuzi {
    color: #f98e3c;
    margin-right: 15px;
  }

  .jilu {
    background-color: transparent;
    border: 1px solid #fff;
    color: #fff;
  }

  .shoukuan {
    background-image: linear-gradient(to right, #fea538, #f27140);
    height: 100vh;
    padding: 20px 10px;
  }

  .saocontent {
    background-color: #fff;
    border-radius: 5px;
    margin: auto;
    padding: 20px;
    display: flex;
    text-align: left;
    p {
      flex: 0 85px;
    }
    ul {
      padding-left: 14px;
      li:first-child {
        color: #f98e3c;
        font-size: 20px;
        margin-bottom: 10px;
      }
      li:last-child {
        color: #723203;
        font-size: 13px;
        line-height: 20px;
      }

    }

  }
</style>

